/**
 * 
 */
package com.roc.dao;

import java.util.List;

import com.roc.bean.CodeNameBean;
import com.roc.bean.MerinfoDetail;
import com.roc.pojo.AreaCode;
import com.roc.pojo.Esmidinfo;
import com.roc.pojo.EsmidinfoMerinfo;
import com.roc.pojo.EsmidinfoTmp;
import com.roc.pojo.MerinfoChange;
import com.roc.pojo.Operators;
import com.roc.pojo.TblEditMchtBankAccount;
import com.roc.pojo.TblEditMchtBizDeal;
import com.roc.pojo.TblEditMchtBizFee;
import com.roc.pojo.TblEditMchtInf;
import com.roc.pojo.TblEditTermInf;
import com.roc.pojo.TblEditTermRiskCfg;
import com.roc.service.ServiceException;

/**
 * @author RenPengFei 2013-5-11 下午4:49:46
 */
public interface IMerchantDao extends IBaseDao {
	
	Operators loadMerchantById(Long id) throws DaoException;

	Operators findUniqueMerchantByNo(String merchantNo) throws DaoException;
	List<Operators> listSomeMerchants(String merType,Long merchantId,String orgCode)throws DaoException;
	List<Operators> listRecommenders()throws DaoException;
	
	  Esmidinfo queryMerinfobyid(String mid) throws DaoException;
	long isDeleted(long merchantId)throws DaoException;
	 //根据商户号查询商户基本信息
	  EsmidinfoTmp  queryMerchant(String  mid)throws DaoException;
	//根据商户号查询商户详细信息
	MerinfoDetail queryMerinfoByNo(String merchantNo)throws DaoException;
	//同步表
	public void theSameMerTable(String  mid,String tmpMid )throws DaoException;
	public void theSameEsTable(String  mid,String tmpMid)throws DaoException;
	
	
	public MerinfoChange queryMerinfoChangeByNo(Long id)throws DaoException;
	
	/**
	 * 查询身份证的使用次数
	 * @param cardNo
	 * @return
	 * @throws DaoException
	 */
	public int checkCardNoTimes(String cardNo) throws DaoException;
	
	/**
	 * 查询营业执照的使用次数
	 * @param busLicences
	 * @return
	 * @throws DaoException
	 */
	public int checkBusLicencesTimes(String busLicences) throws DaoException;
	public boolean queryMerinfoChangeByMid(String mid, String flag)throws DaoException;
	
	/******************************************************************************************************/
	/**
	 * 调用存储过程生成商户sn 号码
	 * */
	public String handleMerchantno(String one,String two,String three)throws DaoException;
	/**
	 * 调用存储过程添加代理商商户关系
	 * @param merinfoNo 商户号
	 * @param merinfoName 商户名称
	 * @param  agentid 当前代理商、操作员的id 
	 * */
	public long addMerinfoAgentRelations(String merinfoNo,String merinfoName,Long  agentId)throws DaoException;
	/**
	 * 调用存储过程添加商户菜单
	 * @param opAccount  当前添加的账号
	 * @param currentOpAccount 当前操作的人员账号
	 * */
	public void addMerinfoModule(String opAccount,String  currentOpAccount)throws DaoException;
	
	 
	
	/**
	 * 查询  
	 * @param SQL
	 * @param params
	 * @return
	 * @throws DaoException
	 */
	List queryBySqlToVo(String SQL,Object... params)throws DaoException;
	
	List<String> updateMerStatusBanch(String merInfo,String type,String account) throws DaoException;
	
	Operators queryOperByRoleAndOrg(String roleType,String orgCode) throws DaoException;
	
	
}
